import request from '@/utils/request'

export const commentApi = {
    // 获取文章评论
    getComments(articleId: string) {
        return request.get(`/api/comments/article/${articleId}`)
    },

    // 添加评论
    addComment(data: {
        article_id: string,
        content: string,
        parent_id?: string | null,
        nickname?: string,
        email?: string | null
    }) {
        return request.post('/api/comments', data)
    },

    // 删除评论
    deleteComment(commentId: string) {
        return request.delete(`/api/comments/${commentId}`)
    }
}